package com.yunshang.ys.ys;

import android.app.ProgressDialog;
import android.support.v4.app.Fragment;

/**
 * Created by Administrator on 2017/6/25.
 */

public class YSFragment extends Fragment {

    ProgressDialog progressDialog;

    public void showProgressDialog(String message, boolean cancelAble) {


//        SingleProgressDialog.getInstance(getActivity().getApplicationContext(),false).show();
        if (progressDialog == null) {
            progressDialog = new ProgressDialog(getActivity());
            progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        }
        progressDialog.setMessage(message);
        progressDialog.setCancelable(cancelAble);
        progressDialog.show();
    }

    public void dismissProgressDialog() {
//        SingleProgressDialog.getInstance(getActivity().getApplicationContext(),false).dismiss();

        if (progressDialog != null) {
            progressDialog.dismiss();
        }
    }
}
